#pragma once
#include "Render\Rendering.h"
#include "Timer\FrameTimer.h"
#include "Input\Input.h"
#include "../Objects/GameObject.h"
#include <vector>
#include <Windows.h>
#include <string>
#include "../Objects/Lights/DirectionalLight.h"
#include "../Objects/Lights/PointLight.h"
#include "../Objects/Lights/SpotLight.h"
class RootSystem
{
private:
	bool m_isEnd;
	void InitializeWindows(int& screenWidth, int& screenHeight,bool _fullScreen);
	void Update();
protected:
	Rendering* rendering;
	FrameTimer* frameTimer;
	Input* input;
	HWND hwnd;
	HINSTANCE hinstance;
	LPCSTR applicationName;
	Camera* camera;
	std::vector<GameObject*> gameObjects;
	std::vector<DirectionalLight*>m_directionalLights;
	std::vector<PointLight*>m_pointLights;
	std::vector<SpotLight*>m_spotLights;
	const std::string m_rootDirectory;
public:
	RootSystem();
	~RootSystem();
	void Initialize();
	void Shutdown();
	void AddGameObject(GameObject* newGameObject);
	void AddDirectionalLight(DirectionalLight* directionalLight);
	void AddPointLight(PointLight* pointLight);
	void AddSpotLight(SpotLight* spotLight);
	void Run();
	LRESULT CALLBACK MessageHandler(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam);
};

static LRESULT CALLBACK WndProc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam);
static RootSystem* ApplicationHandle = 0;